//
//  AppDelegate.h
//  pa
//
//  Created by HaiJiao Chen on 12-7-18.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "ASINetworkQueue.h"

//#define SERVER_URL @"http://localhost/~chenhaijiao"
#define SERVER_URL @"http://paperlessapi.c1.concretego.com"


@class MainObject;

UIKIT_EXTERN NSString *const DataSourceChangeNotification;

@protocol DataSource <NSObject>
@property (nonatomic, readonly) NSArray* data;
@end

@class XMLObject;
@protocol HttpRequestDelegate <NSObject>
-(void)requestFinished:(NSMutableDictionary*)params data:(XMLObject*)data succ:(BOOL)succ;
@end

@interface AppDelegate : UIResponder <UIApplicationDelegate,ASIHTTPRequestDelegate>
{
    ASINetworkQueue* normalQuene;
    NSString* cachePath;
}

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UIViewController *viewController;
@property (nonatomic, assign) UIView* mainView;


@property (nonatomic, retain) NSString* token;
@property (nonatomic, retain) NSString* uid;
@property (nonatomic, retain) NSString* truckID;

-(ASIHTTPRequest*)sendHttpRequest:(NSString*)uri params:(NSMutableDictionary*)params delegate:(id<HttpRequestDelegate>)delegate;

-(ASIHTTPRequest*)postHttpRequest:(NSString*)uri body:(NSDictionary*)body params:(NSMutableDictionary*)params delegate:(id<HttpRequestDelegate>)delegate multipart:(BOOL)multipart;

- (void)cancelRequest:(ASIHTTPRequest*)request;

+ (AppDelegate*)sharedInstance;


@property (nonatomic, readonly) MainObject* main;
@property (nonatomic, readonly) NSString* cachePath;

- (void)logout;







+ (NSString*)getPortName;
+ (void)setPortName:(NSString *)m_portName;
+ (NSString*)getPortSettings;
+ (void)setPortSettings:(NSString *)m_portSettings;
+ (NSString *)HTMLCSS;
@end
